<html>
<head>
<title>Administration Panel - <?php echo HOSTNAME?></title>

<link rel="stylesheet" type="text/css" href="<?php echo PHPDRIVER_WEB?>themes/admin/css/styles.css" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.jquerytools.org/1.2.6/full/jquery.tools.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
  if ($("#messagebox")) {
  	$("#messagebox").overlay({
    	top: 60,
    	mask: {
    		color: '#fff',
    		loadSpeed: 200,
    		opacity: 0.5
    	},
    	closeOnClick: true,
    	load: true
    });
	}
});
</script>
</head>
<body>

<div id="page">
	<div id="header">
		<a href="/" style="float:right;">Vew Site</a>
		<h1>PHPDRIVER / Admin Panel</h1>
	</div>
	<div id="nav">
		<ul>
			<li><a href="/dashboard/admin/index">Dashboard</a></li>
    <?php
    	foreach (scandir(PHPDRIVER . 'modules') as $dir) {
				if (!is_dir(PHPDRIVER . "modules/$dir/admin") || substr($dir, 0, 1) == '.' || $dir == 'dashboard') continue;
    ?>
			<li><a href="/<?php echo $dir?>/admin/index"><?php echo ucwords(str_replace('_', ' ', $dir));?></a></li>
		<?php
			}
		?>
			<li><a href="/logout.html">Logout</a></li>
		</ul>
	</div>
	
	<div id="body">
	<?php
		if (is_file(PHPDRIVER . 'modules/' . module_base() . '/admin/sub_modules.php')) include PHPDRIVER . 'modules/' . module_base() . '/admin/sub_modules.php';
		else {
  		$sub_modules = array();
  		foreach (scandir(PHPDRIVER . 'modules/' . module_base() . '/admin') as $dir) {
  			if (!is_dir(PHPDRIVER . 'modules/' . module_base() . "/admin/$dir") || substr($dir, 0, 1) == '.') continue;
  			$sub_modules[module_base() . "/admin/$dir/index"] = ucwords(str_replace('_', ' ', $dir));
  		}
  		asort($sub_modules);
		}
		
		if (count($sub_modules) > 0) {
	?>
		<div id="module_menu">
		<?php
			foreach ($sub_modules as $module_path => $label) {
				if (is_numeric($module_path)) echo $label;
				else {
		?>
			<a href="/<?php echo $module_path?>"><?php echo $label?></a>
		<?php
				}
			}
		?>
		</div>
	<?php
		}
	?>
	
		<?php load_module(); ?>
	</div>
	
	<div id="footer">
		<span style="float: left;">&copy;2006-<?=date('Y')?> <a href="http://www.aaaadvanced.com/">AAA Advanced, LC</a>. All rights reserved.</span>
		<a href="http://www.phpdriver.org/" id="phdpriver_link">Proudly driven by PHPDriver</a>
	</div>
</div>

<div id="compile_time">
	Compiled in <?php echo number_format(microtime(true)-$GLOBALS['_t'], 4)?> Seconds
</div>

<?php display_messages(); ?>
</body>
</html>